package org.example.kg_back.controller;


import org.example.kg_back.common.result.Result;
import org.example.kg_back.service.imp.AftnService;
import org.example.kg_back.service.imp.CompanyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@RestController
@RequestMapping("/api/company")
public class CompanyController {

	@Autowired
	private CompanyService service;

	@Autowired
	private AftnService aftnService;
	/**
	 * 查询指挥航空公司航班数，和航班延误数
	 * @return
	 */
	@GetMapping("/findCompanyDelay")
	public Result <?> findCompanyDelay(){
		return Result.success(service.findCompanyDelay());
	}


	@GetMapping("/findCompanyByCompanyAll")
	public Result findCompanyByCompanyAll(){
		return Result.success(service.findCompanyByCompanyAll());
	}

	@GetMapping("/getAirPortCount")
	public Result getAirPortCount(){
		return Result.success(aftnService.getAirPortCount());
	}


}
